// regex pattern to "scan" the downloaded string for price and name
// search webpage for the price
Pattern pricePattern = Pattern.compile("</span> \\d+,\\d+ <span class=\"cur\">");
// search webpage for name
Pattern namePattern = Pattern.compile("<div class=\"prodName\">.*</div>");
            
Matcher m;
            
// start a loop that continues until price and name are found or the maximum number of lines is read
while ((s = dis.readLine()) != null && lines < 2*maxlines && !found) {  // double maxlines just to be sure
	webpage += s + "\n";
	lines++;
	progress = ((double)lines/(double)maxlines) * (double)100;
	notifyListeners();
	Log.i(TAG, "downloading ..." + (progress + "%").replaceAll((progress + "%").replaceFirst("\\d*.\\d\\d?", ""), "") + "%");
                
	// set the matcher to match the name pattern
	m = namePattern.matcher(webpage);
                
	if(m.find()){
                    
	// set the name to the found name ... after replacing some strings
	item.name = m.group().replace("<div class=\"prodName\">", "").replaceAll("</div>", "");
	// set the matcher to match the price pattern
	m = pricePattern.matcher(webpage);
                    
		if(m.find()){
			// set the price to the found price ... after replacing some strings
			item.price = Double.parseDouble(m.group().replace("</span>", "").replaceAll("<span class=\"cur\">","").replaceAll("\\s+", "").replace(",", "."));
			found = true;
		}
                    
	}                
                 
}